Agent variables
You may define reusable variables, that can be references in the agent’s prompt, welcome message or Tool parameters.
Defining variables
Variables are defined in ‘Variables’ field in the Agent configuration screen.
Use the NAME = VALUE format. Use multiple lines if you need to specify multiple variables.
For example:
customer_name = Lucy
api_key = 123456
Variables are automatically assigned a type: string, integer, float or boolean, based on the provided value. In the example above, customer_name variable is assigned string, and api_key is assigned an integer type.
Values of type string may be optionally enclosed in quotes, for example: sex = "male".
Alternatively, you may use JSON dictionary format to define agent variables, for example:
{"customer_name": "Lucy", "api_key": 123456}
Derived variables
You may also assign the result of an expression to a variable, using the double-parentheses syntax – NAME = ((expression)). This lets you derive a value from other variables or conversation data. Inside the parentheses, reference other variables by name (without curly brackets) and use any of the supported operators and functions – see Expression syntax.
For example, the following strips a leading + from the caller value, but only when it is present, and stores the result in a new my_caller variable:
my_caller = ((caller[1:] if caller.startswith('+') else caller))
Using variables
To use variables in agent’s prompt / welcome message / tools configuration, specify the variable name enclosed in curly brackets.
For example:
You are parking reminder assistant.
You are calling {customer_name} to remind that her parking will expire soon.
Double brackets are also supported, for example {{customer_name}}.
Variables propagation
In multi-agent topologies variables are automatically propagated to sub-agents. Therefore, variables defined at the top-level agent can still be referenced by any sub-agent or corresponding tool.